﻿<%@ Page Language="C#" MasterPageFile="~/admintractor/admin.master" AutoEventWireup="true" CodeFile="Panel.aspx.cs" Inherits="admintractor_Panel" Title="Khối thông tin" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div id="title">Quản lý khối thông tin </div>
					<div id="view">
						
					    <table style="width: 100%">
                            <tr>
                                <td>
                                    <asp:Label ID="Label1" runat="server" ForeColor="Red"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <table style="width: 100%">
                                        <tr>
                                            <td style="width:130px;">
                                                Tên khối thông tin:*</td>
                                            <td>
                                                <asp:TextBox ID="txtName" runat="server" Width="250px"></asp:TextBox>
                                                    </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                Kênh thông tin:*</td>
                                            <td>
                                                <asp:DropDownList ID="dropChanel" runat="server" Width="200px" 
                                                    AutoPostBack="True" onselectedindexchanged="dropChanel_SelectedIndexChanged">
                                                </asp:DropDownList>
                                                    </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                Vị trí hiển thị:*</td>
                                            <td>
                                                <asp:DropDownList ID="dropCell" runat="server" Width="200px">
                                                </asp:DropDownList></td>
                                        </tr>
                                        <tr>
                                            <td>
                                                Loại điều khiển:*</td>
                                            <td>
                                                <asp:DropDownList ID="dropControl" runat="server" Width="200px">
                                                </asp:DropDownList></td>
                                        </tr>
                                         <tr>
                                            <td>
                                                Loại thông tin:*</td>
                                            <td>
                                                <asp:DropDownList ID="dropCategory" runat="server" Width="200px">
                                                </asp:DropDownList></td>
                                        </tr>
                                        <tr>
                                            <td>
                                                Thứ tự hiển thị:*</td>
                                            <td>
                                                <asp:TextBox ID="txtPriority" runat="server" Width="50px"></asp:TextBox>(số)</td>
                                        </tr>
                                        <tr>
                                            <td>
                                                Hiển thị loại một:*</td>
                                            <td>
                                                <asp:TextBox ID="txtFile1" runat="server" Width="50px"></asp:TextBox>
                                                (số)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Hiển thị loại hai:* <asp:TextBox ID="txtFile2" runat="server" Width="50px"></asp:TextBox>
                                                (số)</td>
                                        </tr>
                                        <tr>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                <asp:CheckBox ID="cb_DisplayALL" runat="server" 
                                                    Text="Hiển thị trên mọi kênh thông tin" />
                                            &nbsp;&nbsp;
                                                <asp:CheckBox ID="cb_DisplayContainer" runat="server" Text="Hiển thị tiêu đề" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                <asp:Button ID="but_add" runat="server" Text="Thêm mới" 
                                                    onclick="but_add_Click" />
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                                        AutoGenerateColumns="False" PageSize="5" 
                                        onpageindexchanging="GridView1_PageIndexChanging">
                                        <Columns>
                                            <asp:BoundField HeaderText="Tiêu đề" DataField="_name"/>
                                            <asp:TemplateField HeaderText="Kênh thông tin">
                                                    <ItemTemplate>
                                                        <%#this.viewchannel((int)(DataBinder.Eval(Container, "DataItem._channelID")))%>
                                                    </ItemTemplate>
                                                    <ItemStyle Width="150px" />
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Vị trí">
                                                    <ItemTemplate>
                                                        <%#this.viewcell((int)(DataBinder.Eval(Container, "DataItem._cellID")))%>
                                                    </ItemTemplate>
                                                    <ItemStyle Width="110px" />
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Thao tác">
                                                <ItemTemplate>
                                                    <table style="width: 100%">
                                                        <tr>
                                                            <td>
                                                                <asp:LinkButton ID="lbEdit" runat="server" Text="Sửa" CommandName="Select" 
                                                                    CommandArgument='<%# Eval("_id","{0}") %>' onclick="lbEdit_Click" ></asp:LinkButton>
                                                            </td>
                                                            <td>
                                                                <asp:LinkButton ID="lbDelete" runat="server" Text="Xóa" CommandArgument='<%# Eval("_id","{0}") %>'
                                                                 CommandName="Select"  OnClientClick="return confirm('Are you sure?');" onclick="lbDelete_Click" 
                                                                ></asp:LinkButton>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </ItemTemplate>
                                                <ItemStyle Width="80px" />
                                            </asp:TemplateField>
                                        </Columns>
                                    </asp:GridView>
                                </td>
                            </tr>
                        </table>
						
					</div>
</asp:Content>

